package com.cx.dao;

import com.cx.domain.user;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import java.util.List;
@Component
public interface userDao {
    @Select("SELECT * FROM `xm_users`")
    List<user> selectall();
    @Insert("INSERT INTO xm_users(`name`,`password`) VALUES(#{name},#{password})")
    void insertuser(@Param("name") String name,@Param("password") String passord);
    @Select("SELECT `name` FROM xm_users WHERE `name`=#{name}")
    String selectname(@Param("name") String name);
    @Delete("DELETE FROM xm_users WHERE name=#{name} and password=#{password}")
    void deleteUser(@Param("name") String name,@Param("password") String password);
}
